/*
 * Copyright (c) 2023 vitasystems GmbH
 *
 * This file is part of project EHRbase Migration Tool
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.ehrbase.migration.exporter.v0.jooq.pg.tables.records;

import java.sql.Timestamp;
import java.util.UUID;
import org.ehrbase.migration.exporter.v0.jooq.pg.tables.CompoXref;
import org.jooq.Field;
import org.jooq.Record4;
import org.jooq.Row4;
import org.jooq.impl.TableRecordImpl;

/**
 * This class is generated by jOOQ.
 */
@SuppressWarnings({"all", "unchecked", "rawtypes"})
public class CompoXrefRecord extends TableRecordImpl<CompoXrefRecord> implements Record4<UUID, UUID, Timestamp, Short> {

    private static final long serialVersionUID = 1L;

    /**
     * Setter for <code>ehr.compo_xref.master_uuid</code>.
     */
    public void setMasterUuid(UUID value) {
        set(0, value);
    }

    /**
     * Getter for <code>ehr.compo_xref.master_uuid</code>.
     */
    public UUID getMasterUuid() {
        return (UUID) get(0);
    }

    /**
     * Setter for <code>ehr.compo_xref.child_uuid</code>.
     */
    public void setChildUuid(UUID value) {
        set(1, value);
    }

    /**
     * Getter for <code>ehr.compo_xref.child_uuid</code>.
     */
    public UUID getChildUuid() {
        return (UUID) get(1);
    }

    /**
     * Setter for <code>ehr.compo_xref.sys_transaction</code>.
     */
    public void setSysTransaction(Timestamp value) {
        set(2, value);
    }

    /**
     * Getter for <code>ehr.compo_xref.sys_transaction</code>.
     */
    public Timestamp getSysTransaction() {
        return (Timestamp) get(2);
    }

    /**
     * Setter for <code>ehr.compo_xref.sys_tenant</code>.
     */
    public void setSysTenant(Short value) {
        set(3, value);
    }

    /**
     * Getter for <code>ehr.compo_xref.sys_tenant</code>.
     */
    public Short getSysTenant() {
        return (Short) get(3);
    }

    // -------------------------------------------------------------------------
    // Record4 type implementation
    // -------------------------------------------------------------------------

    @Override
    public Row4<UUID, UUID, Timestamp, Short> fieldsRow() {
        return (Row4) super.fieldsRow();
    }

    @Override
    public Row4<UUID, UUID, Timestamp, Short> valuesRow() {
        return (Row4) super.valuesRow();
    }

    @Override
    public Field<UUID> field1() {
        return CompoXref.COMPO_XREF.MASTER_UUID;
    }

    @Override
    public Field<UUID> field2() {
        return CompoXref.COMPO_XREF.CHILD_UUID;
    }

    @Override
    public Field<Timestamp> field3() {
        return CompoXref.COMPO_XREF.SYS_TRANSACTION;
    }

    @Override
    public Field<Short> field4() {
        return CompoXref.COMPO_XREF.SYS_TENANT;
    }

    @Override
    public UUID component1() {
        return getMasterUuid();
    }

    @Override
    public UUID component2() {
        return getChildUuid();
    }

    @Override
    public Timestamp component3() {
        return getSysTransaction();
    }

    @Override
    public Short component4() {
        return getSysTenant();
    }

    @Override
    public UUID value1() {
        return getMasterUuid();
    }

    @Override
    public UUID value2() {
        return getChildUuid();
    }

    @Override
    public Timestamp value3() {
        return getSysTransaction();
    }

    @Override
    public Short value4() {
        return getSysTenant();
    }

    @Override
    public CompoXrefRecord value1(UUID value) {
        setMasterUuid(value);
        return this;
    }

    @Override
    public CompoXrefRecord value2(UUID value) {
        setChildUuid(value);
        return this;
    }

    @Override
    public CompoXrefRecord value3(Timestamp value) {
        setSysTransaction(value);
        return this;
    }

    @Override
    public CompoXrefRecord value4(Short value) {
        setSysTenant(value);
        return this;
    }

    @Override
    public CompoXrefRecord values(UUID value1, UUID value2, Timestamp value3, Short value4) {
        value1(value1);
        value2(value2);
        value3(value3);
        value4(value4);
        return this;
    }

    // -------------------------------------------------------------------------
    // Constructors
    // -------------------------------------------------------------------------

    /**
     * Create a detached CompoXrefRecord
     */
    public CompoXrefRecord() {
        super(CompoXref.COMPO_XREF);
    }

    /**
     * Create a detached, initialised CompoXrefRecord
     */
    public CompoXrefRecord(UUID masterUuid, UUID childUuid, Timestamp sysTransaction, Short sysTenant) {
        super(CompoXref.COMPO_XREF);

        setMasterUuid(masterUuid);
        setChildUuid(childUuid);
        setSysTransaction(sysTransaction);
        setSysTenant(sysTenant);
        resetChangedOnNotNull();
    }
}
